#include "stdafx.h"
#include "Sound.h"
#include "SoundWAV.h"
using namespace System::IO;

namespace Reign
{namespace Audio
{namespace XAudio
{
	SoundI^ Sound::Load(DisposableI^ parent, string^ fileName, int instanceCount, bool looped)
	{
		string^ ext = (gcnew FileInfo(fileName))->Extension->ToLower();
		if (ext == L".wav") return gcnew SoundWAV(parent, fileName, instanceCount, looped);

		Debug::ThrowError(L"Sound", string::Format(L"File 'ext' {0} not supported", ext));
		return nullptr;
	}
}
}
}